package biz.obake.team.touchprotector.f;

import android.os.Build;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import biz.obake.team.touchprotector.f.l;
import d.h.b.c;

public final class n implements l {

    /* renamed from: b  reason: collision with root package name */
    private final View.OnSystemUiVisibilityChangeListener f1646b = new a(this);
    /* access modifiers changed from: private */

    /* renamed from: c  reason: collision with root package name */
    public final Handler f1647c = new Handler();

    /* renamed from: d  reason: collision with root package name */
    private final k f1648d;

    static final class a implements View.OnSystemUiVisibilityChangeListener {

        /* renamed from: a  reason: collision with root package name */
        final /* synthetic */ n f1649a;

        /* renamed from: biz.obake.team.touchprotector.f.n$a$a  reason: collision with other inner class name */
        static final class C0073a implements Runnable {

            /* renamed from: b  reason: collision with root package name */
            final /* synthetic */ a f1650b;

            C0073a(a aVar) {
                this.f1650b = aVar;
            }

            public final void run() {
                this.f1650b.f1649a.g();
            }
        }

        a(n nVar) {
            this.f1649a = nVar;
        }

        public final void onSystemUiVisibilityChange(int i) {
            this.f1649a.f1647c.removeCallbacksAndMessages((Object) null);
            this.f1649a.f1647c.post(new C0073a(this));
        }
    }

    static final class b implements Runnable {

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ n f1651b;

        b(n nVar) {
            this.f1651b = nVar;
        }

        public final void run() {
            this.f1651b.g();
        }
    }

    public n(k kVar) {
        c.c(kVar, "mPV");
        this.f1648d = kVar;
    }

    /* access modifiers changed from: private */
    public final void g() {
        int i = biz.obake.team.touchprotector.g.a.g("full_screen") ? 2054 : 0;
        if (Build.VERSION.SDK_INT >= 26) {
            i = i | 2 | 2048;
            if (biz.obake.team.touchprotector.g.a.g("show_navigation_bar")) {
                i = (i & -2049) | 4096;
            }
        }
        this.f1648d.setSystemUiVisibility(i);
    }

    public void a() {
        this.f1648d.setOnSystemUiVisibilityChangeListener((View.OnSystemUiVisibilityChangeListener) null);
    }

    public boolean b(MotionEvent motionEvent) {
        c.c(motionEvent, "event");
        return l.a.a(this, motionEvent);
    }

    public void c() {
        l.a.d(this);
    }

    public void d() {
        this.f1648d.setOnSystemUiVisibilityChangeListener(this.f1646b);
    }

    public final void h() {
        this.f1647c.removeCallbacksAndMessages((Object) null);
        this.f1647c.post(new b(this));
    }
}
